package org.linlinjava.litemall.gameserver.data.write;

import com.cool.wendao.community.model.StoreGoods;
import io.netty.buffer.ByteBuf;
import org.linlinjava.litemall.gameserver.data.GameWriteTool;
import org.linlinjava.litemall.gameserver.netty.BaseWrite;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class M65499_0 extends BaseWrite{
    @Override
    protected void writeO(ByteBuf writeBuf, Object object) {

        List<StoreGoods> list = (List<StoreGoods>) object;
        GameWriteTool.writeString(writeBuf, "");

        GameWriteTool.writeByte(writeBuf, 0);

        GameWriteTool.writeShort(writeBuf, list.size());

        for (int i = 0; i < list.size(); i++) {
            GameWriteTool.writeString(writeBuf, list.get(i).getName());

            GameWriteTool.writeString(writeBuf, list.get(i).getBarcode());

            GameWriteTool.writeShort(writeBuf, list.get(i).getForSale());

            GameWriteTool.writeShort(writeBuf, list.get(i).getShowPos());

            GameWriteTool.writeShort(writeBuf, list.get(i).getRpos());

            GameWriteTool.writeShort(writeBuf, list.get(i).getSaleQuota());

            GameWriteTool.writeShort(writeBuf, list.get(i).getRecommend());

            GameWriteTool.writeInt(writeBuf, list.get(i).getCoin());

            GameWriteTool.writeByte(writeBuf, list.get(i).getDiscount());

            GameWriteTool.writeInt(writeBuf, list.get(i).getDiscount());

            GameWriteTool.writeByte(writeBuf, list.get(i).getType());

            GameWriteTool.writeShort(writeBuf, list.get(i).getQuotaLimit());

            GameWriteTool.writeByte(writeBuf, list.get(i).getMustVip());

            GameWriteTool.writeByte(writeBuf, list.get(i).getIsGift());

            GameWriteTool.writeByte(writeBuf, list.get(i).getFollowPetType());
        }
    }

    @Override
    public int cmd() {
        return 65499;
    }
}























































































































































































































































































































































































































































































































































































































































































































































































































































































































































